﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Text;
using System.Data.Linq;

namespace DomainModel.Entities
{
    // This is the Linq to SQL class for the ApplicantProgress table.
    // This is the bottom layer of the DAL.
    [Table(Name = "ApplicantProgress")]
    public class ApplicantProgress : IDataErrorInfo
    {
        [Column(Name = "applicantProgressID", IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]
        public int ApplicantProgressID { get; set; }

        [Column(Name = "applicationID")]
        public int ApplicationID { get; set; }

        [Column(Name = "had_phone_interview")]
        public Int16 HadPhoneInterview { get; set; }
        [Column(Name = "passed_phone_interview")]
        public Int16 PassedPhoneInterview { get; set; }

        [Column(Name = "had_physical_interview")]
        public Int16 HadPhysicalInterview { get; set; }
        [Column(Name = "passed_physical_interview")]
        public Int16 PassedPhysicalInterview { get; set; }

        [Association(OtherKey = "AnswerID")]
        private EntitySet<AnsweredQuestion> _answeredQuestions = new EntitySet<AnsweredQuestion>();
        public IList<AnsweredQuestion> AnsweredQuestions { get { return _answeredQuestions.ToList().AsReadOnly(); } }

        public string this[string fieldName]
        {
            get
            {
                return null;
            }
        }

        public string Error { get { return null; } }
    }
}